<template>
  <div class="from">
    <div class="title">
      Dockerfile details
    </div>
    <ul class="margin20">
      <li>
        <div class="head">CMD</div>
        <div class="body">
          <div v-for="item in Image.Config.Cmd" :key="item" class="cmdbg">{{ item }}</div>
        </div>
      </li>
      <li>
        <div class="head">ENV</div>
        <div class="body">
          <div v-for="item in Image.Config.Env" :key="item" class="envbox">
            <span style="width: 200px">{{ item.split('=')[0] }}</span>
            {{ item.split('=')[1] }}
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ['Image']
}
</script>

<style lang="scss" scoped>
.envbox{
  line-height: 28px;
  overflow: hidden; //超出部分隐藏
  text-overflow: ellipsis; //超出部分显示...
  white-space: nowrap; //文本强制一行显示
  span{
    display: inline-block;
    width: 150px;
    overflow: hidden; //超出部分隐藏
    text-overflow: ellipsis; //超出部分显示...
    white-space: nowrap; //文本强制一行显示
  }
}
.cmdbg{
  background: pink;
  padding: 2px 3px;
  border-radius: 2px;
  margin: 3px;
}
.from{
  margin-top: 30px;
}
ul{
  li{
    display: flex;
    font-size: 14px;
    color: #333;
    .head{
      // height: 50px;
      // line-height: 50px;
      min-height: 50px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 125px;
      margin-right: 30px;
      font-size: 16px;
      color: #067FB5;
      border-radius: 5px;
      background: #fff;
      border: 1px solid #067FB5;
    }
    &:nth-child(2n-1){
      background: #fff;
      .head:nth-child(2n-1){
        background: #F7FCFF;
      }
    }
    .body{
      padding: 5px 0px;
      font-size: 13px;
      overflow: hidden; //超出部分隐藏
      text-overflow: ellipsis; //超出部分显示...
      white-space: nowrap; //文本强制一行显示
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
  }
}
</style>
